package com.example.customcrash;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity
{

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		ExitAppUtils.getInstance().addActivity(this);

		Button mButton = (Button) findViewById(R.id.button1);

		mButton.setOnClickListener(new OnClickListener()
		{

			@Override
			public void onClick(View v)
			{

				Intent intent = new Intent(MainActivity.this,
		                SecendActivity.class);
				startActivity(intent);
			}
		});
	}

	int i = 0;

	public void addLog(View view)
	{
		String format = String.format("第%3d次点击了按钮", i++);
		LogBuffer.getInstance().log(format, MainActivity.class.getName());
	}
}